package com.kabigon.tiny.service.impl;

import com.kabigon.tiny.dataSource.DataSourceType;
import com.kabigon.tiny.dataSource.anno.DataSource;
import com.kabigon.tiny.mapper.multiple.TbUserMapper;
import com.kabigon.tiny.mapper.multiple.UserAadminMapper;
import com.kabigon.tiny.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author xu.biao
 * @version v1.0
 * @Package com.kabigon.tiny.service.impl
 * @data 2022/12/17 1:47
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private TbUserMapper tbUserMapper;
    @Autowired
    private UserAadminMapper userAadminMapper;

    @Override
    @DataSource(DataSourceType.DataBaseType.MASTER)
    public List<Map<String, Object>> selectList1() {
        return userAadminMapper.selectList();
    }

    @Override
    @DataSource(DataSourceType.DataBaseType.SLAVE)
    public List<Map<String, Object>> selectList2() {
        return tbUserMapper.selectList();
    }
}
